#ifndef MAPMANAGER_H_
#define MAPMANAGER_H_

#include "ATile.h"
#include "Tank.h"
#include "DisplayManager.h"
#include "Wall.h"
#include <cstdio>
#include <allegro.h>


class MapManager
{
public:
	virtual ~MapManager();
	bool tankIntersects(Tank &tank);
	static MapManager *getInstance();
	void init(int w, int h);
	Tank *tankOne;
	Tank *tankTwo;
private:
	MapManager();
	static MapManager *instance;
	bool ifWallIntersects(ATile &tank, int i, int j);
	bool intersects ( int b1_x, int b1_y, int b1_w, int b1_h, int b2_x, int b2_y, int b2_w, int b2_h );
	int getJ(int y);
	int getI(int x);
	ATile *getTile(int i, int j);
	
	int hTNum;
	int vTNum;
	const static int width = 30;
	const static int height = 30;
	ATile *map[300][300];
};

#endif /*MAPMANAGER_H_*/
